package com.example.demo_debezium_pgsql.model;

import com.example.demo_debezium_pgsql.util.DBOperationEnum;

public class ChangeModel<T> {
    private T before;
    private T after;

    private SourceBean source;
    private DBOperationEnum op;
    private long ts_ms;
    private Object transaction;

    public T getBefore() {
        return before;
    }

    public void setBefore(T before) {
        this.before = before;
    }

    public T getAfter() {
        return after;
    }

    public void setAfter(T after) {
        this.after = after;
    }

    public SourceBean getSource() {
        return source;
    }

    public void setSource(SourceBean source) {
        this.source = source;
    }

    public DBOperationEnum getOp() {
        return op;
    }

    public void setOp(DBOperationEnum op) {
        this.op = op;
    }

    public long getTs_ms() {
        return ts_ms;
    }

    public void setTs_ms(long ts_ms) {
        this.ts_ms = ts_ms;
    }

    public Object getTransaction() {
        return transaction;
    }

    public void setTransaction(Object transaction) {
        this.transaction = transaction;
    }

    public static class SourceBean {

        private String version;
        private String connector;
        private String name;
        private long ts_ms;
        private String snapshot;
        private String db;
        private String schema;
        private String table;
        private int txId;
        private int lsn;
        private Object xmin;

        public String getVersion() {
            return version;
        }

        public void setVersion(String version) {
            this.version = version;
        }

        public String getConnector() {
            return connector;
        }

        public void setConnector(String connector) {
            this.connector = connector;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public long getTs_ms() {
            return ts_ms;
        }

        public void setTs_ms(long ts_ms) {
            this.ts_ms = ts_ms;
        }

        public String getSnapshot() {
            return snapshot;
        }

        public void setSnapshot(String snapshot) {
            this.snapshot = snapshot;
        }

        public String getDb() {
            return db;
        }

        public void setDb(String db) {
            this.db = db;
        }

        public String getSchema() {
            return schema;
        }

        public void setSchema(String schema) {
            this.schema = schema;
        }

        public String getTable() {
            return table;
        }

        public void setTable(String table) {
            this.table = table;
        }

        public int getTxId() {
            return txId;
        }

        public void setTxId(int txId) {
            this.txId = txId;
        }

        public int getLsn() {
            return lsn;
        }

        public void setLsn(int lsn) {
            this.lsn = lsn;
        }

        public Object getXmin() {
            return xmin;
        }

        public void setXmin(Object xmin) {
            this.xmin = xmin;
        }
    }
}
